﻿    app.factory('referenciaComprobanteService', function ($http, config) {
        var url = config.baseComprasUrl + 'api/referenciaComprobante';
        var _getList = function () {
            return $http.get(url).then(function (results) {
                return results;
            });
        };
        var _create = function (referenciaComprobante) {
            return $http.post(url, referenciaComprobante).then(function (results) {
                return results;
            });
        };
        var _delete = function (Id) {
            return $http.delete(url, { params: Id }).then(function (results) {
                return results;
            });
        };
        var _update = function (Id, referenciaComprobante) {
            return $http({
                method: 'PUT',
                url: url + "/" + referenciaComprobante.Id,
                data: referenciaComprobante
            }).then(function (results) {
                return results;
            });
        };

        return {
            getList: _getList,
            create: _create,
            delete: _delete,
            update: _update,
        };
    });
